import axios from './axios'
import {appUrl} from '@/config/config'
// /school​/api​/schoolmain​/schoolChat 获取当前用户聊天列表
export const getSchoolChat = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: appUrl + '/school/api/schoolmain/schoolChat',
            method: 'get',
            params
        }).then(res => {
            resolve(res.data)
        })
    })
}
// ​/school​/api​/schoolmain​/schoolChat​/chat 获取学生聊天详情
export const getSchoolChatDetail = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: appUrl + '/school/api/schoolmain/schoolChat/chat',
            method: 'get',
            params
        }).then(res => {
            resolve(res.data)
        })
    })
}
// ​/school​/api​/schoolmain​/schoolChat​/sendChatMsg 发送消息
export const sendChatMsg = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: appUrl + '/school/api/schoolmain/schoolChat/sendChatMsg',
            method: 'post',
            data: params
        }).then(res => {
            resolve(res.data)
        })
    })
}
// ​/school/api/schoolmain/schoolChat/msgReadState
export const msgReadState = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: appUrl + '/school/api/schoolmain/schoolChat/msgReadState',
            method: 'put',
            data: params
        }).then(res => {
            resolve(res.data)
        })
    })
}
// ​/bdc/api/app/student/studentList/{classId} 获取班级学生列表 
export const getStudentList = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: appUrl + '/bdc/api/app/student/studentList/' + params.id,
            method: 'get'
        }).then(res => {
            resolve(res.data)
        })
    })
}
// /bdc/api/app/student/{id}根据userid获取对应学生 
export const getStudentInfo = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: appUrl + '/bdc/api/app/student/' + params.id,
            method: 'get'
        }).then(res => {
            resolve(res.data)
        })
    })
}